package OoTwo;

public class ren {
    private String name;
    private int age;

    private double height;

    public String getName() {
        System.out.print("我的名字是：");
        return name;
    }

    public void setName(String x) {
        name = x;
        System.out.println("你的名字是：" + name);
    }

    public int getAge() {
        System.out.print("我的年龄是：");
        return age;
    }

    public void setAge(int x) {
        if (x < 0) {
            System.out.println("你的年龄有误");
        } else {
            age = x;
            System.out.println("你的名字是：" + age);
        }

    }

    public double getHeight() {
        System.out.print("我的身高是：");
        return height;
    }

    public void setHeight(double y) {
        if (y > 300 || y < 0) {
            System.out.println("你输入的身高有误");
        } else {
            height = y;
            System.out.println("你的身高是：" + height);
        }
    }
}
